#include "ChatClient.h"
//connect to server
void ConnectServer(int &sockfd,struct sockaddr_in servaddr)
{
//taojiezi
sockfd=socket(AF_INET,SOCK_STREAM,0);
if(sockfd==-1)
{
cout<<"socket creation failed..."<<endl;
exit(0);
}
if (connect(sockfd, (const struct sockaddr*)&servaddr, sizeof(servaddr)) != 0) 
{
cout<<"connect failed..."<<endl;
exit(0);
}
cout<<"connect successfully!"<<endl;
}
